home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iacstring4.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.6 KB  |  76 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7.  
  8. Boolean IACpushstring4param (OSType val, OSType keyword) {
  9.  
  10.     return (IACpushstring4item (IACglobals.event, val, keyword));
  11.     } /*IACpushstring4param*/
  12.  
  13.  
  14. Boolean IACreturnstring4 (OSType x) {
  15.     
  16.     return (IACpushstring4item (IACglobals.reply, x, keyDirectObject));
  17.     } /*IACreturnstring4*/
  18.  
  19.  
  20. Boolean IACgetstring4param (OSType keyword, OSType *val) {
  21.     
  22.     if (!IACgetstring4item (IACglobals.event, keyword, val)) {
  23.         
  24.         IACparamerror (IACglobals.errorcode, "\pstring4", keyword);
  25.         
  26.         return (false);
  27.         }
  28.     
  29.     IACglobals.nextparamoptional = false; /*must be reset for each param*/
  30.     
  31.     return (true);
  32.     } /*IACgetstring4param*/
  33.     
  34.  
  35. Boolean IACgetstring4item (AEDescList *list, long n, OSType *val) {
  36.     
  37.     register OSErr ec;
  38.     DescType key;
  39.     DescType typeCode;
  40.     Size actualSize;
  41.     
  42.     if ((*list).descriptorType != typeAEList) {
  43.         
  44.         ec = AEGetKeyPtr (list, n, typeType, &typeCode, (Ptr)val, sizeof (*val), &actualSize);
  45.             
  46.         if (ec != errAEDescNotFound)
  47.             goto done;
  48.         
  49.         }
  50.  
  51.     ec = AEGetNthPtr (list, n, typeType, &key, &typeCode, (Ptr) val, sizeof (*val), &actualSize);
  52.     
  53.     done:
  54.     
  55.     IACglobals.errorcode = ec;
  56.     
  57.     return (ec == noErr);
  58.     } /*IACgetstring4item*/
  59.  
  60.  
  61. Boolean IACpushstring4item (AEDescList *list, OSType val, long n) {
  62.     
  63.     register OSErr ec;
  64.     
  65.     if ((*list).descriptorType != typeAEList)
  66.         ec = AEPutKeyPtr (list, n, typeType, (Ptr)&val, sizeof (val));
  67.     else
  68.         ec = AEPutPtr (list, n, typeType, (Ptr)&val, sizeof (val));
  69.     
  70.     IACglobals.errorcode = ec;
  71.     
  72.     return (ec == noErr);
  73.     } /*IACpushstring4item*/
  74.  
  75.  
  76.